package com.kun.music.service.impl;

import com.kun.music.dao.SongMapper;
import com.kun.music.domain.Song;
import com.kun.music.service.SongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fangkun
 * @create 2022-12-21-15:42
 */
@Service
public class SongServiceImpl implements SongService {

    @Autowired
    private SongMapper songMapper;

    @Override
    public List<Song> allSong() {
        return songMapper.allSong();
    }

    @Override
    public List<Song> getSongOfId(int id) {
        return songMapper.getSongOfId(id);
    }

    @Override
    public List<Song> getSongOfSingerId(int id) {
        return songMapper.getSongOfSingerId(id);
    }

    @Override
    public boolean updateSongMsg(Song song) {
        return songMapper.updateSongMsg(song) > 0 ? true : false;
    }

    @Override
    public boolean deleteSong(int id) {
        return songMapper.deleteSong(id) > 0 ? true :false;
    }

    @Override
    public List<Song> getSongByName(String name) {
        return songMapper.getSongByName(name);
    }
}
